StateBase =class("StateBase")
local interval =Context.interval
function StateBase:onEnter()

end
function StateBase:onExit()

end

function StateBase:onPillarEnter(ui)

  

end

function StateBase:onColliWithDown(ui)
 

end


function StateBase:onColliWithUp(ui)

end

--play xiaoshi effect at up pillar
function StateBase:playXiaoShiUp(ui)
       local xiaoshi =display.newSprite("#xiaoshi0001.png",0,0)
       local xiaoshiframes =display.newFrames("xiaoshi000%01d.png",1,9)
       local xiaoshianimation =display.newAnimation(xiaoshiframes, 1.0 / 9)
       transition.playAnimationOnce(xiaoshi,xiaoshianimation,true)
       ui:addChild(xiaoshi)
       display.align(xiaoshi,display.CENTER, ui.pUpX, ui.pUpRect:getMinY());
end

function StateBase:playXiaoShiDown(ui)
      local xiaoshi2 =display.newSprite("#xiaoshi0001.png",0,0)
       local xiaoshiframes2 =display.newFrames("xiaoshi000%01d.png",1,9)
       local xiaoshianimation2 =display.newAnimation(xiaoshiframes2, 1.0 / 9)
       transition.playAnimationOnce(xiaoshi2,xiaoshianimation2,true)
       ui:addChild(xiaoshi2)
       display.align(xiaoshi2,display.CENTER,ui.pDownX,  ui.pDownRect:getMaxY());
end

function StateBase:onTiming()
 local scene =display.getRunningScene()
 if not scene.isInit then
       scene.isInit =true
       scene:init()
  end

  if viewController:isGameOver() then return end
  viewController:tick(interval)
  scene.updateTime =scene.updateTime+interval
  scene._time=scene._time+interval
  if scene._time>0.5 then
   scene.AnimationLayer:onUpdate()
   scene.uiLayer:onUpdate()
   scene._time =0
  end

 scene.uiLayer:animationUpdate()
 if scene.updateTime>0.1 then
   scene:passCheck()--����Ƿ�ͨ��
   scene.updateTime =0
 end


end
